sdpackage module

class sd.api.sdpackage.SDPackage(APIContext, handle, *args, **kwargs)

Bases: sd.api.sdapiobject.SDAPIObject

A package that can contains SDResource

findResourceFromUrl(sdResourceUrl: str) → Optional[sd.api.sdresource.SDResource]

Retrieve the SDResource that matches the specified resource-URL. The URL can be of different formats, and is relative to the current SDPackage: “pkg:///A/B/MyResource?dependency=XXXXXX” (in a different package), “pkg:///A/B/MyResource” (in the same package), “A/B/MyResource” (on filesystem)

Parameters

sdResourceUrl – The URL of the resource to retrieve

getChildrenResources(isRecursive: bool) → Optional[sd.api.sdarray.SDArray[sd.api.sdresource.SDResource][sd.api.sdresource.SDResource]]

Retrieve resources under the current package

Parameters

isRecursive – If True then all resources at all levels are flattened in ‘outArray’, otherwise only the direct children of the package are retrieved

getClassName() → str

Returns the most specific name of the class this APIObject is

getDependencies() → sd.api.sdarray.SDArray[sd.api.sdpackagedependency.SDPackageDependency][sd.api.sdpackagedependency.SDPackageDependency]

Get the SDPackage dependencies

getFilePath() → str

Get the package file path

getMetadataDict() → sd.api.sdmetadatadict.SDMetadataDict

Get the metadata of this package as a SDMetadataDict.

getUID() → str

Get the package UID

isModified() → bool

Return True if the package is modified.

release() → None

Releases an APIObject